<?php

/**
 * descript:
 * User: blue
 * Date: 2018/9/11 10:53
 */

namespace app\api\validate;


use app\library\base\BaseValidate;

class UserValid extends BaseValidate
{
    protected $rule=[
        'id'=>'require',
        'name'=>'require|min:7|email',
        'email'=>'require|email',
        'password'=>'require',
        'confPassword'=>'require|confirm:password',
        'code'=>'require'
    ];
    protected $message=[
        'name.email'=>'用户必须为邮箱',
        'name.min'=>'用户名必须大于7位',
        'name.require'=>'用户名不能为空',
        'email.requrie'=>'邮箱不能为空',
        'email_email'=>'邮箱格式正确',
        'password.require'=>'密码不能为空',
        'confPassword.require'=>'确认密码不能为空',
        'confPassword.confirm'=>'确认密码不一致',
        'code.require'=>'验证码不能为空'
    ];
    protected $scene=[
        'post'=>['name','password'],
        'login'=>['name','password'],
        'regist'=>['name'],
        //找回密码
        'put'=>['email','code','password','confPassword'],
        'delete'=>['id']
    ];

}